﻿using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        Random random = new Random();
        List<int> numbers = new List<int>();
        for (int i = 0; i < 100; i++)
        {
            numbers.Add(random.Next(0, 1001));
        }

        // 使用 LINQ 对这些整数从大到小排序
        var sortedNumbers = numbers.OrderByDescending(n => n).ToList();

        // 总和
        int sum = sortedNumbers.Sum();

        // 平均数
        double average = sortedNumbers.Average();

        // 结果
        Console.WriteLine("Sorted Numbers (Descending):");
        sortedNumbers.ForEach(n => Console.WriteLine(n));

        Console.WriteLine($"\nSum: {sum}");
        Console.WriteLine($"Average: {average}");
    }
}
